/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bean;

import business.UserBusiness;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
import model.Customer;

/**
 *
 * @author Administrator
 */
@ManagedBean
@RequestScoped
public class FeedbackBean {
    private UserBusiness userBusiness = new UserBusiness();
    private String title;
    private String content;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String feedbackAction(){
        Customer cus = (Customer) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("customer");
        if(userBusiness.customerFeedback(cus.getCustomerID(), title, content)){
            return "finishorder.xhtml";
        }
        return "customer/feedback.xhtml";
    }
    /** Creates a new instance of FeedbackBean */
    public FeedbackBean() {
    }

}
